package com.quanyan.stadium.mapper;

import com.quanyan.stadium.entity.TbGameEvent;
import com.quanyan.stadium.entity.vo.VDefinedGameSchedule;
import com.quanyan.stadium.entity.vo.VDefinedGameScheduleScore;
import com.quanyan.stadium.entity.vo.VDefinedGameTeam;
import com.quanyan.stadium.entity.vo.VGameEventCollect;
import com.quanyan.statium.api.resp.RespUserLastGameEvent;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface VStadiumUserDefinedMapper {


    List<TbGameEvent> searchGameEvent(@Param("cityId") Integer cityId,
                                      @Param("districtId") Integer districtId,
                                      @Param("gameEventType") Byte gameEventType,
                                      @Param("placeId") Integer placeId,
                                      @Param("ids") List<Integer> ids,
                                      @Param("begin") Integer begin,
                                      @Param("pageSize") Integer pageSize);

    int countGameEvent(@Param("cityId") Integer cityId,
                       @Param("districtId") Integer districtId,
                       @Param("gameEventType") Byte gameEventType,
                       @Param("placeId") Integer placeId,
                       @Param("ids") List<Integer> ids);


    List<TbGameEvent> searchGameEventIsMe(@Param("uid") Integer uid,
                                          @Param("cityId") Integer cityId,
                                          @Param("districtId") Integer districtId,
                                          @Param("gameEventType") Byte gameEventType,
                                          @Param("placeId") Integer placeId,
                                          @Param("ids") List<Integer> ids,
                                          @Param("begin") Integer begin,
                                          @Param("pageSize") Integer pageSize);

    int  countGameEventIsMe(@Param("uid") Integer uid,
                            @Param("cityId") Integer cityId,
                            @Param("districtId") Integer districtId,
                            @Param("gameEventType") Byte gameEventType,
                            @Param("placeId") Integer placeId,
                            @Param("ids") List<Integer> ids);


    List<VDefinedGameTeam> selectVDefinedGameTeamList(@Param("gameEventId") Integer gameEventId);


    List<VDefinedGameSchedule> selectVDefinedGameScheduleList(@Param("gameRoundId") Integer gameRoundId,
                                                              @Param("begin") Integer begin,
                                                              @Param("pageSize") Integer pageSize);


    List<VDefinedGameSchedule> selectVDefinedGameScheduleById(@Param("gameScheduleId") Integer gameScheduleId);

    int updateStadiumAmount(@Param("gameId")Integer gameId,
        @Param("num") Integer num);

    int restoreStadiumAmount(@Param("gameIds") List<Integer> gameIds, @Param("num") Integer num);

    List<VGameEventCollect> selectVGameEventCollect();

    List<VGameEventCollect> selectVpkGameEventCollect();

    Integer getUserScoreRank(@Param("categoryId") Integer categoryId,
                             @Param("cityId") Integer cityId,
                             @Param("uid") Integer uid);

    List<VDefinedGameScheduleScore> selectVDefinedGameScheduleScore(@Param("ownEventTeamId") int ownEventTeamId);

    void updateFirstGameEventTeam(@Param("gameScheduleId")Integer gameScheduleId,
                            @Param("gameTeamId") Integer gameTeamId);

    List<Integer> selectUidFromGameTeam(@Param("gameEventId")Integer gameEventId);


    TbGameEvent getUserLastGameEvent(@Param("uid") Integer uid);

    Integer getUserGameEventCount(@Param("uid") Integer uid);

}
